-
Notifications
You must be signed in to change notification settings - Fork 76
Add t17d and t20d diagnostics #1001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev/gfdl
Are you sure you want to change the base?
Conversation
t17d and t20d are the depth of the 17 and 20 degC isotherms respectively, measured from the surface. Interpolation is done via Recon1d reconstruction and then a new function in the class that solves that inverts the reconstruction. This solver was not in the original class because I had originally only thought it would be used in the new grid generator which interpolates density and not for the reconstructed field. Since some other diagnostics for CMIP will make use of remapping or T, I figured we might as well use the reconstructions to do the interpolation. - adds to new registrations and posts in MOM_diagnostics - adds function `%x(self, k, val)` to the Recon1d class.
e207626 to
931ab78
Compare
479adc6 to
931ab78
Compare
| enddo | ||
| else | ||
| ! Non-Boussinesq | ||
| p(0) = 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the surface pressure to 0 will be inaccurate under ice-shelves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
| p(k) = p(k-1) + h(i,j,k) * ( GV%H_to_RZ * GV%g_Earth ) ! Pressure at lower interface | ||
| p(k-1) = 0.5 * ( p(k-1) + p(k) ) ! EOS fn needs pressure in the layer center | ||
| enddo | ||
| call calculate_spec_vol(tv%T(i,j,:), tv%S(i,j,:), p(0:nz-1), spv, tv%eqn_of_state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finding the distance between interfaces using the specific volume at the cell-center is inherently less accurate than actually using the layer-average specific volume, which is usually pre-stored in tv%SpV_avg(:,:,:). If this has not been pre-stored or there is some other reason not to use this, the layer-average specific volume can be obtained by calling average_specific_vol().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know - that means we can avoid this column-wise function call. Is this available independent of USE_TEMPERATURE? How are we ensuring that tv%SpV_avg is always updated when h is updated?
| xr = 1. | ||
| xo = ( t - this%ul(k) ) / slp ! First guess by regula falsi | ||
| f_at_x = this%f(k, xo) | ||
| do iter = 1,5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining why this code is using Newton's method to solve for the root of a quadratic equation rather than just using the closed-form solution. (Could it be that the profile is quadratic in T and S, but with a nonlinear equation of state the function might be nonlinear for density, for example?)
Adds CMIP diagnostics t17d and t20d.
t17d is depth of the 17 degC isotherm. 0m where the ocean is everywhere cooler that 17 degC, and sea-floor when everywhere warmer. Simialrly, t20d is the depth of the 20 degC. "depth" here is defined as distance from the sea-surface.
Result from ocean_only/gloal_ALE/z initial conditions:

Meta-data in output looks like:
Closes #992